﻿<div class="blade-static __bottom" ng-if="pageSettings.itemsPerPageCount < pageSettings.totalItems" ng-include="'pagerTemplate.html'"></div>

<div class="blade-content __medium-wide">
    <div class="blade-inner">
        <div class="inner-block">
            <div class="table-wrapper" ng-init="setGridOptions({
                    useExternalSorting: true,
                    rowTemplate: 'oauthapps-list.row.html',
                    data: 'blade.currentEntities',
                    excludeProperties: ['clientSecret'],
                    columnDefs: [
                        { name: 'displayName', displayName: 'platform.blades.oauthapps.labels.displayName' },
                        { name: 'type', displayName: 'platform.blades.oauthapps.labels.type' },
                        { name: 'clientId', displayName: 'platform.blades.oauthapps.labels.clientId' },
                    ]})">
                <div ng-if="blade.currentEntities.length" ui-grid="gridOptions" hideMenu ui-grid-auto-resize ui-grid-save-state ui-grid-selection ui-grid-resize-columns ui-grid-move-columns ui-grid-pinning ui-grid-height></div>
                <ul class="menu __context" role="menu" id="acc_menu">
                    <li class="menu-item" ng-click='deleteList([contextMenuEntity])' va-permission="platform:security:delete">
                        <i class="menu-ico fa fa-trash-o"></i> {{'platform.commands.delete' | translate}}
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>


<script type="text/ng-template" id="oauthapps-list.row.html">
    <div ng-click='grid.appScope.blade.selectNode(row.entity)' ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell" ng-class="{'ui-grid-row-header-cell': col.isRowHeader, '__hovered': grid.appScope.contextMenuEntity === row.entity, '__selected': row.entity.clientId===grid.appScope.selectedNodeId }" role="{{col.isRowHeader ? 'rowheader' : 'gridcell' }}" ui-grid-cell context-menu="grid.appScope.contextMenuEntity = row.entity" data-target="acc_menu"></div>
</script>
